/**
 * Copyright 2010 Pavel Daniel Alexandru PFA
 * 
 * Licensed under the terms of the GNU Lesser General Public License version 3 
 * as published by the Free Software Foundation. You may obtain a copy of the
 * License at: http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations 
 * under the License. 
 */
package com.kobol.webclient.client.sales.presenter;

import com.allen_sauer.gwt.log.client.Log;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.NameToken;
import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
import com.gwtplatform.mvp.client.proxy.Place;
import com.gwtplatform.mvp.client.proxy.PlaceManager;
import com.gwtplatform.mvp.client.proxy.Proxy;
import com.gwtplatform.mvp.client.proxy.RevealContentEvent;
import com.kobol.webclient.client.NameTokens;
import com.kobol.webclient.client.main.presenter.MainPageSmartGwtPresenter;

/**
 * @author Pavel Alexandru
 * 
 */
public class ActivitiesPresenter extends Presenter<ActivitiesPresenter.MyView, ActivitiesPresenter.MyProxy> {

    @ProxyCodeSplit
    @NameToken(NameTokens.activities)
    public interface MyProxy extends Proxy<ActivitiesPresenter>, Place {
    }

    public interface MyView extends View {
    }

    @Inject
    public ActivitiesPresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager) {
	super(eventBus, view, proxy);
    }

    @Override
    protected void onBind() {
	super.onBind();
    }

    @Override
    protected void onReveal() {
	super.onReveal();

	Log.debug("onReveal() - " + NameTokens.activities);

	MainPageSmartGwtPresenter.getNavigationPaneHeader().setContextAreaHeaderLabelContents(NameTokens.activities);
	MainPageSmartGwtPresenter.getNavigationPane().selectRecord(NameTokens.activities);
    }

    @Override
    protected void onReset() {
	super.onReset();
    }

    @Override
    protected void revealInParent() {
	RevealContentEvent.fire(this, MainPageSmartGwtPresenter.TYPE_SetContextAreaContent, this);
    }
}